﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework
 * Version 2.10
 * 
 * CNR Credentials Class
 *      Represents and manages a set of credentials used for authentication purposes.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;
using Adaptive.Foundation;

namespace Adaptive.Foundation.Network.Cnr
{
    /// <summary>
    /// Represents and manages a set of credentials used for authentication purposes.
    /// </summary>
    public class CnrCredentials : CnrObjectBase
    {
        /*--------------------------------------------------------------------------------
         * Private Member Declarations
         *------------------------------------------------------------------------------*/
        #region Private Member Declarations

        private string _userIdentityValue;
        private string _securityValue;

        #endregion

        /*--------------------------------------------------------------------------------
         * Constructor / Dispose / Destructor Methods
         *------------------------------------------------------------------------------*/
        #region Constructor / Dispose / Destructor Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public CnrCredentials()
            : base()
        {
            _userIdentityValue = string.Empty;
            _securityValue = string.Empty;
        }
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="userIdentityValue">A user identity value.</param>
        /// <param name="securityValue">A password or other security value.</param>
        public CnrCredentials(string userIdentityValue, string securityValue)
            : base()
        {
            _userIdentityValue = userIdentityValue;
            _securityValue = securityValue;
        }
        /// <summary>
        /// Deallocates internally allocated objects.
        /// </summary>
        /// <param name="disposing">
        /// A value indicating whether the object is being disposed.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if ((!Disposed) && (disposing))
            {
            }
            _userIdentityValue = null;
            _securityValue = null;
            base.Dispose(disposing);
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Properties
         *------------------------------------------------------------------------------*/
        #region Public Properties
        /// <summary>
        /// Gets or sets the user identity value for the credentials.
        /// </summary>
        /// <value>
        /// A user ID or other identifying value.
        /// </value>
        public string UserIdentityValue
        {
            get { return _userIdentityValue; }
            set { _userIdentityValue = value; }
        }
        /// <summary>
        /// Gets or sets the security value for the credentials.
        /// </summary>
        /// <value>
        /// A user password or other security value.
        /// </value>
        public string SecurityValue
        {
            get { return _securityValue; }
            set { _securityValue = value; }
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Public Methods / Functions
        /// <summary>
        /// Clears the contents of the object instance without disposing of the instance.
        /// </summary>
        public override void Clear()
        {
            _securityValue = string.Empty;
            _userIdentityValue = string.Empty;
        }
        #endregion
    }
}